<template>
	<div>
		myMath:{{$store.state.mymathAbout.sub}}
		big:{{$store.getters.bigSum}}
		<button @click="increment">增加</button>
		<button @click="incrementOdd">奇数增加</button>
	</div>
</template>

<script>
	export default {
		name:'MyMath',
		data() {
			return {
				n:1, //用户选择的数字
			}
		},
		methods: {
			increment(){
				this.$store.commit('ADD',this.n)
			},
			incrementOdd(){
				this.$store.dispatch('addOdd',this.n)
			},
		},
		mounted() {
			console.log('MyMath',this)
		},
	}
</script>

<style lang="css">
	button{
		margin-left: 5px;
	}
</style>
